home *** CD-ROM | disk | FTP | other *** search
- /* GetSize.c */
-
- /* This routine returns the size of a SoundFile */
- /* which was saved in either IFF or FutureSound */
- /* format, and which resides in the current */
- /* default directory. */
-
- /* Usage : GetSize(filename) */
- /* filename is a pointer to a string */
-
- /* converted to use AmigaDOS I/O calls, John Foust, 6/22/86 */
-
- #include "exec/types.h"
- #include "lattice/stdio.h"
- #include "SoundErrors.h"
-
- #include "libraries/dosextens.h"
-
- extern struct FileHandle *Open();
-
- extern ULONG SizeIFF();
-
- ULONG GetSize(filename)
- char *filename;
- {
- /* FILE *fp; */
- struct FileHandle *fp; /* File Pointer */
- ULONG len; /* Data Length */
-
- /* Is it an IFF File? */
- if((len = SizeIFF(filename)) == 0)
- {
- /* No, then open for FutureSound format */
- if((fp = Open(filename,MODE_OLDFILE)) == 0)
- {
- return((ULONG) Error(OPEN_ERROR,filename));
- }
- /* Read Data Length */
- if (Read(fp,&len,sizeof(len)) == 0)
- {
- return((ULONG) Error(READ_ERROR,filename));
- }
- /* Close File */
- Close(fp);
- }
- /* Return Data Length */
- return(len);
- }
-
-